package junyi.card;

/**
 * User: Junyi BEI
 * Date: 12-9-30
 * Time: 下午1:55
 */
public class Size implements CardProperty{
  private int sizeInt;
  
  public final static Size ACE = new Size(1);
  public final static Size ONE = new Size(1);
  public final static Size TWO = new Size(2);
  public final static Size THREE = new Size(3);
  public final static Size FOUR = new Size(4);
  public final static Size FIVE = new Size(5);
  public final static Size SIX = new Size(6);
  public final static Size SEVEN = new Size(7);
  public final static Size EIGHT = new Size(8);
  public final static Size NIGHT = new Size(9);
  public final static Size TEN = new Size(10);
  public final static Size JACK = new Size(11);
  public final static Size ELEVEN = new Size(11);
  public final static Size QUEEN = new Size(12);
  public final static Size TWELVE = new Size(12);
  public final static Size KING = new Size(13);
  public final static Size THIRTEEN = new Size(13);

  public Size(int s) {
    sizeInt = s;
  }

  public int getSizeInt() {
    return sizeInt;
  }

  public int greaterThan(Card c) {
    if(sizeInt > c.getSize().getSizeInt()) {
      return CardProperty.SUCCESS;
    }
    return CardProperty.FAILURE;
  }

  public int lessThan(Card c) {
    if(sizeInt < c.getSize().getSizeInt()) {
      return CardProperty.SUCCESS;
    }
    return CardProperty.FAILURE;
  }

  public int equalsTo(Card c) {
    if(c.getSize().getSizeInt() == sizeInt) {
      return CardProperty.SUCCESS;
    }
    return CardProperty.FAILURE;
  }
}
